﻿@page
@using dotnetcore_Demo.Models

@inject dotnetcore_Demo.Services.IDepartmentService departmentService

<div class="row">
    <div class="col-md-10 offset-md-2">
        <table class="table">
            <tr>
                <th>Name</th>
                <th>Location</th>
                <th>Employee Count</th>
                <th>操作</th>
            </tr>
            <tr>
                <td>@Html.DisplayFor(x => x.Departments)</td>
            </tr>
        </table>
    </div>
</div>

@functions{
    public IEnumerable<Department> Departments { get; set; }

    public async Task OnGetAsync()
    {
        Departments = await departmentService.GetAll();
    }
}